package libro.cap04.contratos;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.ResourceBundle;

public class UConnection {

	private static Connection con = null;

	public static Connection getConnection() {

		try {

			String usuario = "root";
			String pass = "1234";
			String driver = "com.mysql.jdbc.Driver";
			String base = "test";
			String url = "jdbc:mysql://localhost/" + base;
			
			Class.forName(driver);
			con = DriverManager.getConnection(url, usuario, pass);
			return con;
		}

		catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException("Error de conexion" + e);
		}
	}
}
